package me.zingon.MapDemo.controller;

import me.zingon.MapDemo.service.BusLineService;
import me.zingon.MapDemo.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/test")
public class TestControtller {

    @Autowired
    TestService testService;

    @Autowired
    BusLineService busLineService;

    @RequestMapping("/list.do")
    @ResponseBody
    public Object listAll(){
        return testService.listAll();
    }

    @RequestMapping("/page.*")
    public String resolveTo(){
        return "/test";
    }

    @RequestMapping("/gbl.do")
    @ResponseBody
    public Object getBusLines(){
        return busLineService.getBusLines();
    }

    @RequestMapping("/getPos.do")
    @ResponseBody
    public Object getNewPos(){
        return busLineService.getNewPos();
    }
}
